﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Project_Commission.aspx.cs"
    Inherits="EcSalseManage.EcSalse.Report_Commission" %>

<%@ Register Src="../PageCommon/Report_Tab.ascx" TagName="Report_Tab" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script language="javascript" type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>

    <script type="text/javascript">
//        var xmlRequest;
//        function getXMLRequestObject() {

//            if (window.XMLHttpRequest) {
//                xmlRequest = new XMLHttpRequest();
//            }
//            else if (window.ActiveXObject) {
//                xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
//            }
//            return xmlRequest;
//        }

//        function getData(flag, id) {


//            var url = "GetGridViewByConditionForm.aspx"; //要请求的数据库返回的数据页面
//            //得到请求对象

//            xmlRequest = getXMLRequestObject();
//            if (xmlRequest == null) {
//                alert("您的浏览器不支持AJAX!");
//                return;
//            }
//            if (flag == "load") {
//                //load 表示是页面加载数据
//                url += "?flag=load&Mainid=" + id + "&temp=" + Math.random();
//                //状态改变  
//                xmlRequest.onreadystatechange = dataChanged;
//                xmlRequest.open("GET", url, true);
//                xmlRequest.send(null);  // 发送请求
//            } else if (flag == "add") {
//                url += "?flag=add&Report_Commission_Money=" + document.getElementById("NewReport_Commission_Money").value + "&Report_Commission_InvoiceNO=" + document.getElementById("NewReport_Commission_InvoiceNO").value + "&temp=" + Math.random();
//                //状态改变  
//                xmlRequest.onreadystatechange = dataChanged;
//                xmlRequest.open("GET", url, true);
//                xmlRequest.send(null);  // 发送请求
//            } else if (flag == "update") {
//                var Report_Commission_InvoiceNO = document.getElementById('txtReport_Commission_InvoiceNO' + id).value;
//                var Report_Commission_Money = document.getElementById('txtReport_Commission_Money' + id).value;
//                url += "?flag=update&id=" + id + "&Report_Commission_InvoiceNO=" + Report_Commission_InvoiceNO + "&Report_Commission_Money=" + Report_Commission_Money;
//                url = encodeURI(url);
//                //状态改变  
//                xmlRequest.onreadystatechange = dataChanged;
//                xmlRequest.open("POST", url, true);
//                xmlRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
//                xmlRequest.send(url);  // 发送请求
//            } else if (flag == "delete") {
//                url += "?flag=delete&id=" + id;
//                url = encodeURI(url);
//                //状态改变  
//                xmlRequest.onreadystatechange = dataChanged;
//                xmlRequest.open("POST", url, true);
//                xmlRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
//                xmlRequest.send(url);  // 发送请求
//            } else if (flag == "close") {

//            }



//        }
//        function dataChanged() {
//            if (xmlRequest.readyState == 4) {
//                if (xmlRequest.status == 200) {
//                    showDatas(); //已经可以正常接受数据

//                } else { //页面不正常  
//                    window.alert("您所请求的页面有异常。");
//                }
//            }
//        }
//        //表格部分显示数据  
//        function showDatas() {
//            //从响应页面得到数据
//            var message = xmlRequest.responseText;
//            var tc = message.substring(message.indexOf('<div id="container">'), message.Length);
//            //显示数据
//            document.getElementById("ShowSearchResult").innerHTML = tc;

//        }

//        function changeView(Report_Commission_ID, Report_Commission_InvoiceNO, Report_Commission_Money) {
//            objReport_Commission_InvoiceNO = document.getElementById('Report_Commission_InvoiceNO' + Report_Commission_ID);
//            objReport_Commission_Money = document.getElementById('Report_Commission_Money' + Report_Commission_ID);
//            objManage = document.getElementById('Manage' + Report_Commission_ID);

//            objReport_Commission_InvoiceNO.innerHTML = "<input type='text' style='width:47px;'  id='txtReport_Commission_InvoiceNO" + Report_Commission_ID + "'  value='" + Report_Commission_InvoiceNO + "'>";
//            objReport_Commission_Money.innerHTML = "<input type='text' style='width:47px;'  id='txtReport_Commission_Money" + Report_Commission_ID + "'  value='" + Report_Commission_Money + "'>";
//            objManage.innerHTML = "<a href=javascript:getData('update','" + Report_Commission_ID + "')>更新</a> &nbsp;<a href=javascript:getData('load','')>取消</a>";
//        }



        
    </script>

    <style type="text/css">
        .aa
        {
            background-image: url(..../images/u65_normal.png);
            width: 121px;
            text-align: center;
            height: 26;
            line-height: 26px;
            display: inline-block;
        }
        .asel
        {
            background-image: url(..../images/u59_normal.png);
            width: 121px;
            text-align: center;
            height: 26;
            line-height: 26px;
            display: inline-block;
            color: #FFFFFF;
        }
        .style1
        {
            width: 100%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="17" valign="top" background="../images/mail_leftbg.gif">
                <img src="../images/left-top-right.gif" width="17" height="29" />
            </td>
            <td valign="top" background="../images/content-bg.gif">
                <uc1:Report_Tab ID="Report_Tab1" runat="server" />
            </td>
            <td width="16" valign="top" background="../images/mail_rightbg.gif">
                <img src="../images/nav-right-bg.gif" width="16" height="29" />
            </td>
        </tr>
        <tr>
            <td valign="middle" background="../images/mail_leftbg.gif">
                &nbsp;
            </td>
            <td valign="top" bgcolor="#F7F8F9">
                <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="4" valign="top">
                            <table width="98%">
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td  style="width:100%">
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <div style="margin-bottom: -2px;" id="daili">
                                            <asp:LinkButton ID="lbtnEarlyPlot" class="aa" runat="server" OnClick="lbtnEarlyPlot_Click"
                                                Visible="false">前期策划</asp:LinkButton>
                                            <asp:LinkButton ID="lbtnSalseAgency" Visible="false" class="aa" runat="server" OnClick="lbtnSalseAgency_Click">销售代理</asp:LinkButton>
                                            <asp:LinkButton ID="lbtnLease" Visible="false" class="aa" runat="server" OnClick="lbtnLease_Click">招租</asp:LinkButton>
                                            <asp:LinkButton ID="lbtnUnionComm" Visible="false" class="aa" runat="server" OnClick="lbtnUnionComm_Click">联动</asp:LinkButton>
                                        </div>
                                        <div id="pg1" class="page" style="padding: 20px;">
                                            <table id="statisticsTable" width="100%" runat="server" style=" border:1px solid #000000;"   border="1" cellpadding="1" cellspacing="1" >
                                                <tr>
                                                    <td>
                                                        合计成交套数
                                                    </td>
                                                    <td>
                                                        合计成交金额
                                                    </td>
                                                    <td>
                                                        预计可收到佣金
                                                    </td>
                                                    <td>
                                                        已收到佣金
                                                    </td>
                                                    <td>
                                                        待收回佣金
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="Label5" runat="server" Text="Label"></asp:Label>
                                                    </td>
                                                </tr>
                                            </table>
                                            <br />
                                            <asp:GridView ID="gvwConfirmation" AutoGenerateColumns="false" ShowFooter="True" 
                                                BackColor="#FFFFED" runat="server" Height="35px" Width="98%" Visible="false"
                                                DataKeyNames="Project_Confirmation_ID" OnPreRender="gvwConfirmation_PreRender"
                                                OnRowCommand="gvwConfirmation_RowCommand" OnRowEditing="gvwConfirmation_RowEditing"
                                                OnRowCancelingEdit="gvwConfirmation_RowCancelingEdit" OnRowUpdating="gvwConfirmation_RowUpdating">
                                                <Columns>
                                                    <asp:TemplateField>
                                                        <HeaderTemplate>
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <%# Container.DataItemIndex + 1%>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-BackColor="#FFEFD5" ItemStyle-BackColor="#FFEFD5">
                                                        <HeaderTemplate>
                                                            确认书编号
                                                        </HeaderTemplate>
                                                        <HeaderStyle Width="2%" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblNo" runat="server" Text='<%# Eval("Project_Confirmation_NO") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtEditNO" Width="100" Text='<%# Bind("Project_Confirmation_NO") %>' runat="server"></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <FooterTemplate>
                                                            <asp:TextBox ID="txtNo" Width="100" runat="server"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtNo"
                                                                Display="None" ValidationGroup="VG_WZ" ErrorMessage="确认书编号不能为空！"></asp:RequiredFieldValidator>
                                                        </FooterTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-BackColor="#FFEFD5" ItemStyle-BackColor="#FFEFD5">
                                                        <HeaderTemplate>
                                                            确佣金额
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblAmount" runat="server" Text='<%# Eval("Project_Confirmation_Amount") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtEditAmount" Width="100" Text='<%# Eval("Project_Confirmation_Amount") %>'
                                                                runat="server"></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <FooterTemplate>
                                                            <asp:TextBox ID="txtAmount" Width="100" runat="server"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtAmount"
                                                                Display="None" ValidationGroup="VG_WZ" ErrorMessage="确佣金额不能为空！"></asp:RequiredFieldValidator>
                                                        </FooterTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-BackColor="#FFEFD5" ItemStyle-BackColor="#FFEFD5">
                                                        <HeaderTemplate>
                                                            确认书日期
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblDate" runat="server" Text='<%# Eval("Project_Confirmation_Date","{0:yyyy-MM-dd}") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtEditDate" Width="100" class="Wdate" onclick="WdatePicker()" Text='<%# Eval("Project_Confirmation_Date","{0:yyyy-MM-dd}") %>'
                                                                runat="server"></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <FooterTemplate>
                                                            <asp:TextBox ID="txtDate" Width="100" class="Wdate" onclick="WdatePicker()" runat="server"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtDate"
                                                                Display="None" ValidationGroup="VG_WZ" ErrorMessage="日期不能为空！"></asp:RequiredFieldValidator>
                                                        </FooterTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-BackColor="#BC8F8F" ItemStyle-BackColor="#BC8F8F">
                                                        <HeaderTemplate>
                                                            发展商是否确认
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("Project_Confirmation_Status").ToString()=="0"?"未确认":"确认" %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:DropDownList ID="ddlStatus"  runat="server">
                                                                <asp:ListItem Text="未确认" Value="0"></asp:ListItem>
                                                                <asp:ListItem Text="确认" Value="1"></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-BackColor="#BC8F8F" ItemStyle-BackColor="#BC8F8F">
                                                        <HeaderTemplate>
                                                            发展商确认佣金
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblDeveloperAmount" runat="server" Text='<%# Eval("Project_Confirmation_DeveloperAmount") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtDeveloperAmount"  Width="127" Text='<%# Eval("Project_Confirmation_DeveloperAmount") %>' runat="server"></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-BackColor="#F4A460" ItemStyle-BackColor="#F4A460">
                                                        <HeaderTemplate>
                                                            已部分收佣日期
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblCommissionDate" runat="server" Text='<%# Eval("Project_Confirmation_CommissionDate","{0:yyyy-MM-dd}") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtCommissionDate"  Width="127" class="Wdate" onclick="WdatePicker()" runat="server"></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-BackColor="#F4A460" ItemStyle-BackColor="#F4A460">
                                                        <HeaderTemplate>
                                                            已部分收佣金额
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblPartCommission" runat="server" Text='<%# Eval("Project_Confirmation_PartCommission") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtPartCommission"  Width="127" runat="server"></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField>
                                                        <HeaderTemplate>
                                                            操作
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            
                                                            <asp:LinkButton ID="lkbEdit" runat="server" CausesValidation="False" Visible='<%# Eval("Project_Confirmation_Status").ToString()=="2"?false:true %>' CommandName="Edit"
                                                                Text="编辑"></asp:LinkButton>
                                                            
                                                       
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:LinkButton ID="lkbUpdate" runat="server" CausesValidation="True" CommandName="Update"
                                                                Text="更新"></asp:LinkButton>
                                                            &nbsp;<asp:LinkButton ID="lkbDelete" runat="server" CausesValidation="False" CommandName="Cancel"
                                                                Text="取消"></asp:LinkButton>
                                                        </EditItemTemplate>
                                                        <FooterTemplate>
                                                            <asp:Button ID="btnAdd" runat="server" Text="添加" ValidationGroup="VG_WZ" CommandName="Insert" />
                                                            <asp:ValidationSummary ID="ValidationSummary1" ValidationGroup="VG_WZ" ShowMessageBox="true"
                                                                ShowSummary="false" runat="server" />
                                                        </FooterTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>
                                            <br />
                                            <br />
                                            <table id="detailTable" style="display: none;">
                                                <tr>
                                                    <td>
                                                        1.已做确认书
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        确认书编号<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>；确认书确佣金额
                                                        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        2.发展商已核确认书。
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        确认书编号<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>；发展商回复确认书确佣金额<asp:TextBox
                                                            ID="TextBox4" runat="server"></asp:TextBox><asp:Button ID="Button2" runat="server"
                                                                Text="确认" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        3、已部分收佣
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        该项目<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>已收到佣金
                                                        <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>&nbsp;<asp:Button ID="Button3"
                                                            runat="server" Text="确认" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <%--  <div id="ShowSearchResult">
                                         </div>--%>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td height="40" colspan="4">
                            <table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
                                <tr>
                                    <td>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td width="2%">
                            &nbsp;
                        </td>
                        <td width="51%" class="left_txt">
                            <img src="../images/icon-mail2.gif" width="16" height="11">
                            客户服务邮箱：servers@centaline.com<br>
                            <img src="../images/icon-phone.gif" width="17" height="14">
                            官方网站：http://www.centaline.com.cn/
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
            <td background="../images/mail_rightbg.gif">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td valign="bottom" background="../images/mail_leftbg.gif">
                <img src="../images/buttom_left2.gif" width="17" height="17" />
            </td>
            <td background="../images/buttom_bgs.gif">
                <img src="../images/buttom_bgs.gif" width="17" height="17">
            </td>
            <td valign="bottom" background="../images/mail_rightbg.gif">
                <img src="../images/buttom_right2.gif" width="16" height="17" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
